package com.qingfeng.music.ui.billboard.contract;

import com.qingfeng.music.bean.PlayBean;
import com.qingfeng.music.bean.SongRankBean;
import com.qingfeng.music.dao.Music;
import com.shuji.android.library.BaseModel;
import com.shuji.android.library.BasePresenter;
import com.shuji.android.library.BaseView;

import java.util.List;

import rx.Observable;

/**
 * 榜单歌曲 Billboard 接口规范定义
 *
 * Created by Ganlin.Wu on 2016/10/14.
 */
public interface BillboardContract {


    /**
     * Model
     *
     */
    interface Model extends BaseModel {

        /**
         * 取得歌曲列表
         *
         * @param format
         //* @param callback
         * @param from
         * @param method
         * @param type
         * @param size
         * @param offset
         * @return
         */
        Observable<SongRankBean> getBillBoardMusics(String format,  String from, String method, int type, int size, int offset);

        /**
         * 取得播放信息
         *
         * @param format
        // * @param callback
         * @param from
         * @param method
         * @param songid
         * @return
         */
        Observable<PlayBean> getPlay(String format, String from, String method, String songid);
    }

    /**
     * View
     *
     */
    interface View extends BaseView {

        /**
         *
         *
         * @param url
         */
        void showBackdrop(String url);

        /**
         * 显示歌曲
         *
         * @param musics
         */
        void showBillBoardMusics(List<Music> musics);
    }


    /**
     * Presenter
     *
     */
    abstract class Presenter extends BasePresenter<View, Model> {

        /**
         * 加载排行榜音乐
         *
         * @param format
         //* @param callback
         * @param from
         * @param method
         * @param type
         * @param size
         * @param offset
         */
        public abstract void loadBillboardMusics(String format, String from, String method, int type, int size, int offset);
    }
}
